From: Georges Basile Stavracas Neto Date: Wed, 2 Dec 2020 18:58:49 +0000 (-0300) Subject: appDisplay/baseAppView: Update page indicators on page-changed X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~616^2^2~704 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=10d91b52e7c3c046e6f4a16848239c80696b8dfc;p=gnome-shell.git appDisplay/baseAppView: Update page indicators on page-changed The number of pages doesn't depend on the allocated size anymore. Move updating page indicators from BaseAppView.adaptToSize() to a IconGrid::pages-changed callback. Part-of: --- diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index 71aee7bc3..1fd088ebf 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -138,6 +138,12 @@ var BaseAppView = GObject.registerClass({ this._grid._delegate = this; // Standard hack for ClutterBinLayout this._grid.x_expand = true; + this._grid.connect('pages-changed', () => { + this._adjustment.value = 0; + this.goToPage(this._grid.currentPage); + this._pageIndicators.setNPages(this._grid.nPages); + this._pageIndicators.setCurrentPosition(this._grid.currentPage); + }); const vertical = orientation === Clutter.Orientation.VERTICAL; @@ -850,18 +856,6 @@ var BaseAppView = GObject.registerClass({ this._grid.adaptToSize(availWidth, availHeight); - if (this._availWidth !== availWidth || - this._availHeight !== availHeight || - this._pageIndicators.nPages !== this._grid.nPages) { - Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => { - this._adjustment.value = 0; - this.goToPage(this._grid.currentPage); - this._pageIndicators.setNPages(this._grid.nPages); - this._pageIndicators.setCurrentPosition(this._grid.currentPage); - return GLib.SOURCE_REMOVE; - }); - } - this._availWidth = availWidth; this._availHeight = availHeight; }